package io.renren.modules.wcs.listenSlaveDB;

import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import org.springframework.web.context.ServletContextAware;

import javax.servlet.ServletContext;

/**
 * @Author: 蔡翔
 * @Date: 2019/12/2 11:17
 * @Version 1.0
 *
 * //系统启动时 ：把 数据库中已存在的 AGV信息（消费者），，加载到系统中，
 */
@Component
@Order(value = 1)
public class InitialSlaveThread implements ApplicationRunner {
    private static SalveThread t = new SalveThread();


    @Override
    public void run(ApplicationArguments args) throws Exception {
        System.err.println("=======begin=======");
        t.setName("SlaveThread");
        if(!t.isAlive()){
            t.start();
        }
        System.err.println("=======end=======");

    }
}
